home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / notes / caller < prev    next >
Encoding:
Text File  |  1990-09-26  |  783 b   |  35 lines

  1. #! /bin/sh
  2. # Display files that a particular module calls.
  3. # Use: caller module
  4. #
  5. # Todo: arrange to kill the file if the script is interrupted.
  6.  
  7. if [ $# != 1 ] ; then
  8.     echo "Use: callee module"
  9.     exit 1
  10. fi
  11.  
  12. module=$1
  13.  
  14. tmpFile=/tmp/caller$$
  15.  
  16. rm -f $tmpFile
  17.  
  18. moduleList="$module/*.[ch]"
  19. if [ $module = vm ] ; then
  20.     moduleList="$moduleList machine/pmap.[ch]"
  21. fi
  22.  
  23. grep "#include" $moduleList > $tmpFile
  24.  
  25. emacs -batch $tmpFile -l /users/kupfer/emacs/caller.el -f save-buffer > /dev/null
  26.  
  27. sort $tmpFile | uniq
  28. rm $tmpFile
  29.  
  30. # Look through the resulting list of .h files.  Do "aid" on likely
  31. # looking strings (e.g., "thread", "port"), grepping for lines that
  32. # contain "vm/", "sun3/", or "mach/sun3/".  Run the list through
  33. # callee.el, get rid of noise, and edit into the .h file list.
  34.